package kr.blogspot.stiner01.moduletutorial;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class LifeCycleTest extends Activity
{
    private StringBuilder _builder = new StringBuilder();
    private TextView _textView = null;
    
    private void log(String text)
    {
        Log.d("LifeCycleTest",text);
        
        _builder.append(text);
        _builder.append('\n');
        
        _textView.setText(_builder.toString());
    }
    
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        _textView = new TextView(this);
        
        setContentView(_textView);
        
        log("created");
    }
    
    @Override
    protected void onResume()
    {
        super.onResume();
        
        log("resumed");
    }
    
    @Override
    protected void onPause()
    {
        super.onPause();
        
        log("paused");
        
        if (isFinishing())
        {
            log("finishing");
        }
    }
}
